package cn.gson.springboot.model.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.gson.springboot.model.dao.SupplierDao;
import cn.gson.springboot.model.mapper.SupplierMapper;
import cn.gson.springboot.model.pojos.Drug;
import cn.gson.springboot.model.pojos.Supplier;

@Service
@Transactional(rollbackFor = Exception.class)
public class SupplierService {

	@Autowired
	private SupplierDao supplierdao; 	//	供应商dao层
	
	@Autowired
	private SupplierMapper suppliermapper; //供应商Mapper层
	
	//添加供应商
	public void AddSupplier(Supplier entity) {
		supplierdao.save(entity);
	}
	
	//查询所有供应商
	public List<Supplier> FindAllSupplier() {		
		return (List<Supplier>) suppliermapper.findallsupplier();
	}
	
	//修改供应商
	public void updatesupplier(Integer supplierNumber,String supplierLinkpeople,String supplierTel) {
		suppliermapper.updatesupplier(supplierNumber, supplierLinkpeople, supplierTel);
	}

}
